﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Alchemy.Classes;

namespace PServiceBus.AlchemyWebSocket {
    public class AlchemyWebSocketConnection : PServiceBus.Core.Interface.IWebSocketConnection {
        UserContext context;
        public AlchemyWebSocketConnection(UserContext ctx) {
            context = ctx;
            ClientIpAddress = ctx.ClientAddress.ToString();
        }

        #region IWebSocketConnection Members

        public void Send(string message) {
            context.Send(message);
        }

        public void Close() {
            throw new InvalidOperationException("close connection");
        }

        public Guid ID { get; set; }

        public string ClientIpAddress { get; set; }
        #endregion
    }
}
